<template>
     <div id="showpop">
    <div class="nav bg-theme color-f text-l" >
     <div style="display:flex;flex:2;">
          <i class="iconfont icon-fanhui font19 pl08 iback" @click="gotoMobile()"></i>
          <!-- 详情进入 -->
          <span class="font19 ml16">
              {{ pagename }}
          </span>
        </div>
          <span v-if='showSet&&true' style="margin-right:10px;margin-left:10px">
            <van-icon @click="toset"  name="setting-o" size="25" />
          </span>
          <span v-if='showCreat' style="margin-right:10px;margin-left:10px">
            <van-icon @click="todraw" name="add-o" size="25"/>
          </span>
            <span  style="margin-right:10px;margin-left:10px">
            <van-icon @click="searchDialog()" name="search" size="25"/>
          </span>
    </div> 
     
    <div class="pageview">
       
        <component :is="tabviewName" ref="searchdata"  style="height:calc(100vh - 50px)"></component>
        <!-- //首页待办已办弹窗 -->
         <van-popup v-model="showTodoDialog" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
            <van-field 
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
           
              v-model="todoDialogCode"
              label="工单编号:"
              placeholder="请填写工单编号"
            />
             <van-field 
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
               v-model="todoDialogTitle"
            
              label="工单标题:"
              placeholder="请填写工单标题"
            />
            <div style="display: flex;margin:20px 0 0 0">
              <div style="width:50% ;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="chongzhibutton" 
                 type="default"
                 >
                 重置</van-button>
              </div>
             
              <div style="width:50%;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="cancelbutton" 
                 type="primary" 
                 color="#60a9ec"
                 >
                 查询</van-button>
              </div>
            </div>
            </van-popup>
         <!-- 政策宣讲台账弹窗 -->
         <van-popup v-model="showZcxjDialog" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
            <van-field
                readonly
                input-align="left" 设置文字位置
                label-width="2.5em"  设置标题长度
                clickable
                v-model="zcxjDialogOrgName"
                label="单位:"
                placeholder="请选择单位"
                @click="showOrgPickerDialog('1')"
                />
                <van-popup v-model="showOrgPickerTab1" position="bottom" get-container="#showpop">
                    <van-picker
                        visible-item-count="6"
                        show-toolbar
                        :columns="showOrgcolumns"
                        @confirm="showOrgPickeronConfirm"
                        @cancel="showOrgPickerTab1 = false"
                    />
                </van-popup> 

            <van-field 
              input-align="left" 设置文字位置
              label-width="2.5em"  设置标题长度
              v-model="zcxjDialogWangge"
              label="网格:"
              placeholder="请填写网格"
            />
             <van-field 
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
              v-model="zcxjDialogTitle"
              label="工单标题:"
              placeholder="请填写工单标题"
            />
            <van-field
              readonly
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
              clickable
              v-model="zcxjDialogType"
              label="完成情况:"
              placeholder="请选择"
              @click="showzcxjDialogTypeDialog=true"
              />
              <van-popup v-model="showzcxjDialogTypeDialog" position="bottom" get-container="#showpop">
                  <van-picker
                      visible-item-count="4"
                      show-toolbar
                      :columns="zcxjDialogTypecolumns"
                      @confirm="zcxjDialogTypeonConfirm"
                      @cancel="showzcxjDialogTypeDialog = false"
                  />
              </van-popup> 
            <van-field 
              readonly
              input-align="left"
              label-width="8.5em"
              clickable
              v-model="zcxjDialogStrTime"
              label="宣讲开始时间:"
              placeholder="请选择开始时间"
              @click="showZcxjDialogStrTime = true"
              />
              <van-popup v-model="showZcxjDialogStrTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                     v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showZcxjDialogStrTime = false"
                    @confirm="showZcxjDialogStrTimeonfirm"
                />
              </van-popup>      
            <van-field 
              readonly
              input-align="left"
              label-width="8.5em"
              clickable
              v-model="zcxjDialogEndTime"
              label="宣讲结束时间:"
              placeholder="请选择结束时间"
              @click="showZcxjDialogEndTime = true"
              />
              <van-popup v-model="showZcxjDialogEndTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showZcxjDialogEndTime = false"
                    @confirm="showZcxjDialogEndTimeonfirm"
                />
              </van-popup>        

            <div style="display: flex;margin:20px 0 0 0">
              <div style="width:50% ;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="chongzhibutton" 
                 type="default"
                 >
                 重置</van-button>
              </div>
             
              <div style="width:50%;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="cancelbutton" 
                 type="primary" 
                 color="#60a9ec"
                 >
                 查询</van-button>
              </div>
            </div>
         </van-popup>  
          <!-- 思政纪实台账弹窗 -->
         <van-popup v-model="showSzjsDialog" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
            <van-field 
              input-align="left" 设置文字位置
              label-width="9.5em"  设置标题长度
              v-model="szjsDialogInfo"
              label="谈话主题或走访事项:"
              placeholder="请填写谈话主题或走访事项"
            />
            <van-field 
              readonly
              input-align="left"
              label-width="9.5em"
              clickable
              v-model="szjsDialogStrTime"
              label="谈话或走访开始时间:"
              placeholder="请选择开始时间"
              @click="showSzjsDialogStrTime = true"
              />
              <van-popup v-model="showSzjsDialogStrTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showSzjsDialogStrTime = false"
                    @confirm="showSzjsDialogStrTimeonfirm"
                />
              </van-popup>      
            <van-field 
              readonly
              input-align="left"
              label-width="9.5em"
              clickable
              v-model="szjsDialogEndTime"
              label="谈话或走访结束时间:"
              placeholder="请选择结束时间"
              @click="showSzjsDialogEndTime = true"
              />
              <van-popup v-model="showSzjsDialogEndTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showSzjsDialogEndTime = false"
                    @confirm="showSzjsDialogEndTimeonfirm"
                />
              </van-popup>        
            <van-field
                readonly
                input-align="left" 设置文字位置
                label-width="4.5em"  设置标题长度
                clickable
                v-model="szjsDialogOrgName"
                label="上报部门:"
                placeholder="请选择单位"
                @click="showOrgPickerDialog('2')"
                />
                <van-popup v-model="showOrgPickerTab2" position="bottom" get-container="#showpop">
                    <van-picker
                        visible-item-count="6"
                        show-toolbar
                        :columns="showOrgcolumns"
                        @confirm="showOrgPickeronConfirm"
                        @cancel="showOrgPickerTab2 = false"
                    />
                </van-popup> 
           
            <div style="display: flex;margin:20px 0 0 0">
              <div style="width:50% ;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="chongzhibutton" 
                 type="default"
                 >
                 重置</van-button>
              </div>
             
              <div style="width:50%;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="cancelbutton" 
                 type="primary" 
                 color="#60a9ec"
                 >
                 查询</van-button>
              </div>
            </div>
         </van-popup>   
        <!-- 问题协调台账弹窗 -->
         <van-popup v-model="showWtsbDialog" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
           
            <van-field 
              readonly
              input-align="left"
              label-width="6.5em"
              clickable
              v-model="wtsbDialogStrTime"
              label="上报开始时间:"
              placeholder="请选择开始时间"
              @click="showWtsbDialogStrTime = true"
              />
              <van-popup v-model="showWtsbDialogStrTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showWtsbDialogStrTime = false"
                    @confirm="showWtsbDialogStrTimeonfirm"
                />
              </van-popup>      
            <van-field 
              readonly
              input-align="left"
              label-width="6.5em"
              clickable
              v-model="wtsbDialogEndTime"
              label="上报结束时间:"
              placeholder="请选择结束时间"
              @click="showWtsbDialogEndTime = true"
              />
              <van-popup v-model="showWtsbDialogEndTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showWtsbDialogEndTime = false"
                    @confirm="showWtsbDialogEndTimeonfirm"
                />
              </van-popup>      
             <van-field 
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
              v-model="wtsbDialogTitle"
              label="问题名称:"
              placeholder="请填写问题名称"
            />    
            <van-field
                readonly
                input-align="left" 设置文字位置
                label-width="4.5em"  设置标题长度
                clickable
                v-model="wtsbDialogOrgName"
                label="上报部门:"
                placeholder="请选择单位"
                @click="showOrgPickerDialog('3')"
                />
                <van-popup v-model="showOrgPickerTab3" position="bottom" get-container="#showpop">
                    <van-picker
                        visible-item-count="6"
                        show-toolbar
                        :columns="showOrgcolumns"
                        @confirm="showOrgPickeronConfirm"
                        @cancel="showOrgPickerTab3 = false"
                    />
                </van-popup> 
             <van-field
              readonly
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
              clickable
              v-model="wtsbDialogType"
              label="完成情况:"
              placeholder="请选择"
              @click="showWtsbDialogType=true"
              />
              <van-popup v-model="showWtsbDialogType" position="bottom" get-container="#showpop">
                  <van-picker
                      visible-item-count="4"
                      show-toolbar
                      :columns="zcxjDialogTypecolumns"
                      @confirm="zcxjDialogTypeonConfirm"
                      @cancel="showWtsbDialogType = false"
                  />
              </van-popup>         
            <div style="display: flex;margin:20px 0 0 0">
              <div style="width:50% ;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="chongzhibutton" 
                 type="default"
                 >
                 重置</van-button>
              </div>
             
              <div style="width:50%;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="cancelbutton" 
                 type="primary" 
                 color="#60a9ec"
                 >
                 查询</van-button>
              </div>
            </div>
         </van-popup>    
         <!--经验推广台账弹窗 -->
         <van-popup v-model="showJytgDialog" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
           
            <van-field 
              readonly
              input-align="left"
              label-width="6.5em"
              clickable
              v-model="jytgDialogStrTime"
              label="上报开始时间:"
              placeholder="请选择开始时间"
              @click="showJytgDialogStrTime = true"
              />
              <van-popup v-model="showJytgDialogStrTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showJytgDialogStrTime = false"
                    @confirm="showJytgDialogStrTimeonfirm"
                />
              </van-popup>      
            <van-field 
              readonly
              input-align="left"
              label-width="6.5em"
              clickable
              v-model="jytgDialogEndTime"
              label="上报结束时间:"
              placeholder="请选择结束时间"
              @click="showJytgDialogEndTime = true"
              />
              <van-popup v-model="showJytgDialogEndTime" position="bottom" get-container="#showpop">
                <van-datetime-picker
                    :formatter="formatter"
                    type="date"
                    v-model="nowDate"
                    :min-date="strDate"
                    :max-date="maxDate"
                    @cancel="showJytgDialogEndTime = false"
                    @confirm="showJytgDialogEndTimeonfirm"
                />
              </van-popup>      
            <van-field 
              input-align="left" 设置文字位置
              label-width="6.5em"  设置标题长度
              v-model="jytgDialogTitle"
              label="优秀案例名称:"
              placeholder="请填写优秀案例名称"
            />    
            <van-field
                readonly
                input-align="left" 设置文字位置
                label-width="4.5em"  设置标题长度
                clickable
                v-model="jytgDialogOrgName"
                label="上报部门:"
                placeholder="请选择单位"
                @click="showOrgPickerDialog('4')"
                />
                <van-popup v-model="showOrgPickerTab4" position="bottom" get-container="#showpop">
                    <van-picker
                        visible-item-count="6"
                        show-toolbar
                        :columns="showOrgcolumns"
                        @confirm="showOrgPickeronConfirm"
                        @cancel="showOrgPickerTab4 = false"
                    />
                </van-popup> 
             <van-field
              readonly
              input-align="left" 设置文字位置
              label-width="4.5em"  设置标题长度
              clickable
              v-model="jytgDialogType"
              label="完成情况:"
              placeholder="请选择"
              @click="showJytgDialogType=true"
              />
              <van-popup v-model="showJytgDialogType" position="bottom" get-container="#showpop">
                  <van-picker
                      visible-item-count="4"
                      show-toolbar
                      :columns="zcxjDialogTypecolumns"
                      @confirm="zcxjDialogTypeonConfirm"
                      @cancel="showJytgDialogType = false"
                  />
              </van-popup>         
            <div style="display: flex;margin:20px 0 0 0">
              <div style="width:50% ;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="chongzhibutton" 
                 type="default"
                 >
                 重置</van-button>
              </div>
             
              <div style="width:50%;text-align: center;">
                 <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px" 
                 @click="cancelbutton" 
                 type="primary" 
                 color="#60a9ec"
                 >
                 查询</van-button>
              </div>
            </div>
         </van-popup>     
        <van-tabbar v-model="active" @change="onchange">
            <van-tabbar-item >
              <span>我的工作</span>
              <template #icon="props">
                <img :src="props.active ?icon.active :icon.inactive"/>
              </template>
            </van-tabbar-item>
              <van-tabbar-item >
              <span>政策宣讲</span>
              <template #icon="props">
                <img :src="props.active ?icon1.active :icon1.inactive"/>
              </template>
            </van-tabbar-item>
              <van-tabbar-item >
              <span>思政纪实</span>
              <template #icon="props">
                <img :src="props.active ?icon2.active :icon2.inactive"/>
              </template>
            </van-tabbar-item>
              <van-tabbar-item >
              <span>问题协调</span>
              <template #icon="props">
                <img :src="props.active ?icon3.active :icon3.inactive"/>
              </template>
            </van-tabbar-item>
              <van-tabbar-item >
              <span>经验推广</span>
              <template #icon="props">
                <img :src="props.active ?icon4.active :icon4.inactive"/>
              </template>
            </van-tabbar-item>
             <!-- <van-tabbar-item icon="search" >政策宣讲</van-tabbar-item>
              <van-tabbar-item icon="search" >思政纪实</van-tabbar-item>
               <van-tabbar-item icon="search" >问题协调</van-tabbar-item>
                <van-tabbar-item icon="search" >经验推广</van-tabbar-item> -->
          </van-tabbar>
      
    </div>
   
  </div>    
</template>
<script type="text/javascript">
import tabview0 from '@/components/tabitemzero'
import tabview1 from '@/components/tabitemone'
import tabview2 from '@/components/tabitemtwo'
import tabview3 from '@/components/tabitemthree'
import tabview4 from '@/components/tabitemfour'
import {getInfo} from '@/api/login'
import {mapGetters} from "vuex"
import {getOrgdata} from "@/api/gettodo";
import { Notify } from 'vant'
import moment from 'moment'
export default {
    data(){
        return {
            pagename: this.$route.query.pagename,
            tabNumber: this.$route.query.tabNumber,
            tabviewName:'',
            iconName:'search',
            iconset:'set',
            active: 0,
            icon: {
                   active:require('../../assets/images/home_checked.png'),
                   inactive:require('../../assets/images/home.png')
            },
            icon1: {
                   active:require('../../assets/images/zcxj_selected.png'),
                   inactive:require('../../assets/images/zcxj.png')
            },
            icon2: {
                   active:require('../../assets/images/wtsb_selected.png'),
                   inactive:require('../../assets/images/wtsb.png')
            },
            icon3: {
                   active:require('../../assets/images/szjs_selected.png'),
                   inactive:require('../../assets/images/szjs.png')
            },
            icon4: {
                   active:require('../../assets/images/jytg_selected.png'),
                   inactive:require('../../assets/images/jytg.png')
            },
            showCreat:false,
            showSet:false,
            setmenuType:false,
            todoDialogCode:'',
            todoDialogTitle:'',
            showTodoDialog:false,
            showZcxjDialog:false,
            showSzjsDialog:false,
            showWtsbDialog:false,
            showJytgDialog:false,
            showOrgPickerTab1:false,
            showOrgPickerTab2:false,
            showOrgPickerTab3:false,
            showOrgPickerTab4:false,
            orgList:[],
            showOrgcolumns:[],
            zcxjDialogOrgName:'',
            zcxjDialogOrgCode:'',
            zcxjDialogWangge:'',
            zcxjDialogTitle:'',
            zcxjDialogType:'',
            zcxjDialogTypeCode:'',
            showzcxjDialogTypeDialog:false,
            zcxjDialogTypecolumns:['未完成','已完成'],
            zcxjDialogStrTime:'',
            showZcxjDialogStrTime:false,
            zcxjDialogEndTime:'',
            showZcxjDialogEndTime:false,
            nowDate: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
            strDate: new Date(new Date().getFullYear()-10, new Date().getMonth(), new Date().getDate()),
            maxDate: new Date(new Date().getFullYear()+10, new Date().getMonth(), new Date().getDate()),
            szjsDialogInfo:'',
            szjsDialogStrTime:'',
            showSzjsDialogStrTime:false,
            szjsDialogEndTime:'',
            showSzjsDialogEndTime:false,
            szjsDialogOrgName:'',
            szjsDialogOrgCode:'',
            wtsbDialogType:'',
            wtsbDialogTypeCode:'',
            wtsbDialogStrTime:'',
            showWtsbDialogStrTime:false,
            wtsbDialogEndTime:'',
            wtsbDialogTitle:'',
            showWtsbDialogEndTime:false,
            wtsbDialogOrgName:'',
            wtsbDialogOrgCode:'',
            showWtsbDialogType:false,

            jytgDialogType:'',
            jytgDialogTypeCode:'',
            jytgDialogStrTime:'',
            showJytgDialogStrTime:false,
            jytgDialogEndTime:'',
            jytgDialogTitle:'',
            showJytgDialogEndTime:false,
            jytgDialogOrgName:'',
            jytgDialogOrgCode:'',
            showJytgDialogType:false,
        }
    },
    computed:{
      ...mapGetters(['user']),
      ...mapGetters(['haszcxjmenu']),
      ...mapGetters(['hassetmenu']),
      ...mapGetters(['hassetmenuadd']),
      ...mapGetters(['haswtsbmenu']),
      ...mapGetters(['hasjytgmenu']),
      // ...mapGetters(['userinfo']),
        // "webpack": "^4.46.0"
    },
    created(){
        console.log('是否拥有配置权限'+this.haszcxjmenu);
          console.log('是否拥有配置权限'+this.hassetmenu);
          console.log('是否拥有配置权限'+this.hassetmenuadd);
            console.log('是否拥有配置权限'+this.haswtsbmenu);
              console.log('是否拥有配置权限'+this.hasjytgmenu);
        // console.log('用户信息'+JSON.stringify(this.userinfo.truename));
        this.setmenuType=this.hassetmenu;
        if(!this.pagename){
          this.pagename='0'
        }
        if(!this.tabNumber){
          this.tabNumber='0'
        }
      
    },
    activated(){
       
    },
    components:{
        // Tab,
        // TabItem,
        tabview0,
        tabview1,
        tabview2,
        tabview3,
        tabview4
    },
    mounted(){//在所有函数之前，会优先执行的内容
        mapGetters(['user'])
      mapGetters(['haszcxjmenu'])
      mapGetters(['hassetmenu'])
      mapGetters(['hassetmenuadd'])
      mapGetters(['haswtsbmenu'])
      mapGetters(['hasjytgmenu'])
        if (window.history && window.history.pushState) {
            console.log('注册物理返回键');
            history.pushState(null, null, document.URL);
            window.addEventListener('popstate', this.gotoMobile, false);//false阻止默认事件
            //  this.$router.push(
            //         {
            //             name:'mainview',
            //             query:{
                         
            //             }
            //         }
            //     )
        }
        //读取存储的tab位置参数
        if (localStorage.getItem('tabactiveNumber') != ''&&localStorage.getItem('tabactiveNumber')) {
          console.log('读取存储的tab位置参数')
          this.active = JSON.parse(localStorage.getItem('tabactiveNumber'))
          // localStorage.setItem('tabactiveNumber', '')
          // this.onchange(this.active);
          if(this.active==1){
            this.tabviewName='tabview1'
            this.pagename='政策宣讲'
            if(this.haszcxjmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=1;
          }else if(this.active==2){
            this.tabviewName='tabview2'
            this.pagename='思政纪实'
            this.active=2;
            if(this.hassetmenuadd){
                  this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            if(this.hassetmenu){
                this.showSet=true;
            }else{
                this.showSet=false;
            }
         
          }else if(this.active==3){
            this.tabviewName='tabview3'
            this.pagename='问题协调'
            if(this.haswtsbmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=3;
          }else if(this.active==4){
            this.tabviewName='tabview4'
            this.pagename='经验推广'
            if(this.hasjytgmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=4;
          }else{
            this.tabviewName='tabview0'
            this.pagename='我的工作'
            this.showCreat=false;
            this.active=0;
          }
        }else{
          console.log('主界面跳转进入')
          if(this.tabNumber==1){
            this.tabviewName='tabview1'
            this.pagename='政策宣讲'
            if(this.haszcxjmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=1;
            localStorage.setItem('tabactiveNumber', 1)
          }else if(this.tabNumber==2){
            this.tabviewName='tabview2'
            this.pagename='思政纪实'
            if(this.hassetmenuadd){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            if(this.hassetmenu){
                this.showSet=true;
            }else{
                this.showSet=false;
            }
            this.showCreat=true;
            this.active=2;
            localStorage.setItem('tabactiveNumber', 2)
          }else if(this.tabNumber==3){
            this.tabviewName='tabview3'
            this.pagename='问题协调'
            if(this.haswtsbmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=3;
            localStorage.setItem('tabactiveNumber', 3)
          }else if(this.tabNumber==4){
            this.tabviewName='tabview4'
            this.pagename='经验推广'
            if(this.hasjytgmenu){
                this.showCreat=true;
            }else{
                this.showCreat=false;
            }
            this.showSet=false;
            this.active=4;
            localStorage.setItem('tabactiveNumber', 4)
          }else{
            this.tabviewName='tabview0'
            this.pagename='我的工作'
            this.showCreat=false;
            this.active=0;
            localStorage.setItem('tabactiveNumber', 0)
          }
        }
        
    },
    methods:{
        searchDialog(){
          if(this.active==0){
            this.showTodoDialog=true;  
          }else if(this.active==1){
            this.showZcxjDialog=true;
          }else if(this.active==2){
            this.showSzjsDialog=true;
          }else if(this.active==3){
            this.showWtsbDialog=true;
          }else if(this.active==4){
            this.showJytgDialog=true;
          }
        },
        chongzhibutton(){ //点击重置按钮
          if(this.active==0){
            this.showTodoDialog=false;
            this.todoDialogCode='';
            this.todoDialogTitle='';
            this.$refs.searchdata.setsearchdata(this.todoDialogCode,this.todoDialogTitle);    
          }else if(this.active==1){
            this.showZcxjDialog=false;
            this.zcxjDialogOrgName='';
            this.zcxjDialogOrgCode='';
            this.zcxjDialogWangge='';
            this.zcxjDialogTitle='';
            this.zcxjDialogType='';
            this.zcxjDialogTypeCode='';
            this.zcxjDialogStrTime='';
            this.zcxjDialogEndTime='';
            this.$refs.searchdata.setsearchdata(
              this.zcxjDialogOrgName,this.zcxjDialogOrgCode,this.zcxjDialogWangge
              ,this.zcxjDialogTitle,this.zcxjDialogTypeCode,this.zcxjDialogStrTime
              ,this.zcxjDialogEndTime);
          }else if(this.active==2){
            this.szjsDialogInfo='',
            this.szjsDialogStrTime='',
            this.showSzjsDialogStrTime=false,
            this.szjsDialogEndTime='',
            this.showSzjsDialogEndTime=false,
            this.szjsDialogOrgName='',
            this.szjsDialogOrgCode='',
            this.showSzjsDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.szjsDialogOrgName, this.szjsDialogOrgCode, this.szjsDialogInfo,
              this.szjsDialogStrTime, this.szjsDialogEndTime, '',
            );

          }else if(this.active==3){
            this.wtsbDialogType='',
            this.wtsbDialogTypeCode='',
            this.wtsbDialogStrTime='',
            this.wtsbDialogEndTime='',
            this.wtsbDialogTitle='',
            this.wtsbDialogOrgName='',
            this.wtsbDialogOrgCode='',
            this.showWtsbDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.wtsbDialogOrgName, this.wtsbDialogOrgCode, this.wtsbDialogTitle,
              this.wtsbDialogStrTime, this.wtsbDialogEndTime, this.wtsbDialogTypeCode
            );
          }else if(this.active==4){
            this.jytgDialogType='',
            this.jytgDialogTypeCode='',
            this.jytgDialogStrTime='',
            this.jytgDialogEndTime='',
            this.jytgDialogTitle='',
            this.jytgDialogOrgName='',
            this.jytgDialogOrgCode='',
            this.showJytgDialog=false,
            this.$refs.searchdata.setsearchdata(
              this.jytgDialogOrgName, this.jytgDialogOrgCode, this.jytgDialogTitle,
              this.jytgDialogStrTime, this.jytgDialogEndTime, this.jytgDialogTypeCode
            );
          }
        },
        cancelbutton(){  //点击查询按钮
          if(this.active==0){
            this.showTodoDialog=false; 
            this.$refs.searchdata.setsearchdata(this.todoDialogCode,this.todoDialogTitle);    
          }else if(this.active==1){
            this.showZcxjDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.zcxjDialogOrgName,this.zcxjDialogOrgCode,this.zcxjDialogWangge
              ,this.zcxjDialogTitle,this.zcxjDialogTypeCode,this.zcxjDialogStrTime
              ,this.zcxjDialogEndTime);
          }else if(this.active==2){
            this.showSzjsDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.szjsDialogOrgName, this.szjsDialogOrgCode, this.szjsDialogInfo,
              this.szjsDialogStrTime, this.szjsDialogEndTime, 
              this.szjsDialogStrTime+'至'+this.szjsDialogEndTime,
          );
          }else if(this.active==3){
            this.showWtsbDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.wtsbDialogOrgName, this.wtsbDialogOrgCode, this.wtsbDialogTitle,
              this.wtsbDialogStrTime, this.wtsbDialogEndTime, this.wtsbDialogTypeCode
            );
          }else if(this.active==4){
            this.showJytgDialog=false;
            this.$refs.searchdata.setsearchdata(
              this.jytgDialogOrgName, this.jytgDialogOrgCode, this.jytgDialogTitle,
              this.jytgDialogStrTime, this.jytgDialogEndTime, this.jytgDialogTypeCode
            );
          }
        },
        showOrgPickerDialog(value){
          
          getOrgdata(Object.assign({userName:this.user.userName}))
            .then((res)=>{
              if(!res.data){
                Notify(res.message);
                return;
              }
              this.showOrgcolumns=[];
              this.orgList=[];
              for(var i=0;i<res.data.data.length;i++){
                this.showOrgcolumns.push(res.data.data[i].name);
              }
              this.orgList=res.data.data;
              if(value=='1'){
                this.showOrgPickerTab1=true;
              }else if(value=='2'){
                this.showOrgPickerTab2=true;  
              }else if(value=='3'){
                this.showOrgPickerTab3=true;
              }else if(value=='4'){
                this.showOrgPickerTab4=true;
              }
              
            })
            .catch((error) => {
                Notify({ type: 'warning', message: '获取数据失败,请稍后重试' })
            });
        },
        showOrgPickeronConfirm(value,index){
          
          if(this.active==1){
            this.showOrgPickerTab1=false;
            this.zcxjDialogOrgName=value;
            this.zcxjDialogOrgCode=this.orgList[index].value;
          }else if(this.active==2){
            this.showOrgPickerTab2=false;
            this.szjsDialogOrgName=value;
            this.szjsDialogOrgCode=this.orgList[index].value;
          }else if(this.active==3){
            this.showOrgPickerTab3=false;
            this.wtsbDialogOrgName=value;
            this.wtsbDialogOrgCode=this.orgList[index].value;
          }else if(this.active==4){
            this.showOrgPickerTab4=false;
            this.jytgDialogOrgName=value;
            this.jytgDialogOrgCode=this.orgList[index].value;
          }
        },
        zcxjDialogTypeonConfirm(value,index){
          
          if(this.active==1){
            this.zcxjDialogType=value;
            this.showzcxjDialogTypeDialog=false;
            if(value=='未完成'){
              this.zcxjDialogTypeCode="1";
            }else if(value=='已完成'){
              this.zcxjDialogTypeCode="7";
            }
          }else if(this.active==3){
            this.wtsbDialogType=value;
            this.showWtsbDialogType=false;
            if(value=='未完成'){
              this.wtsbDialogTypeCode="2";
            }else if(value=='已完成'){
              this.wtsbDialogTypeCode="7";
            }
          }else if(this.active==4){
            this.jytgDialogType=value;
            this.showJytgDialogType=false;
            if(value=='未完成'){
              this.jytgDialogTypeCode="2";
            }else if(value=='已完成'){
              this.jytgDialogTypeCode="7";
            }
          }
          
        },
        showZcxjDialogStrTimeonfirm(value){
          this.zcxjDialogStrTime=moment(value).format('YYYY-MM-DD')
          this.showZcxjDialogStrTime=false;
        },
        showZcxjDialogEndTimeonfirm(value){
          this.zcxjDialogEndTime=moment(value).format('YYYY-MM-DD')
          this.showZcxjDialogEndTime=false;
        },
        showSzjsDialogStrTimeonfirm(value){
          this.szjsDialogStrTime=moment(value).format('YYYY-MM-DD')
          this.showSzjsDialogStrTime=false;
        },
        showSzjsDialogEndTimeonfirm(value){
          this.szjsDialogEndTime=moment(value).format('YYYY-MM-DD')
          this.showSzjsDialogEndTime=false;
        },
        showWtsbDialogStrTimeonfirm(value){
          this.wtsbDialogStrTime=moment(value).format('YYYY-MM-DD')
          this.showWtsbDialogStrTime=false;
        },
        showWtsbDialogEndTimeonfirm(value){
          this.wtsbDialogEndTime=moment(value).format('YYYY-MM-DD')
          this.showWtsbDialogEndTime=false;
        },
         showJytgDialogStrTimeonfirm(value){
          this.jytgDialogStrTime=moment(value).format('YYYY-MM-DD')
          this.showJytgDialogStrTime=false;
        },
        showJytgDialogEndTimeonfirm(value){
          this.jytgDialogEndTime=moment(value).format('YYYY-MM-DD')
          this.showJytgDialogEndTime=false;
        },

        gotoMobile(){
          this.addlistener();  
          console.log('gotoMobile')
          if(this.active==0&&this.showTodoDialog){
            this.showTodoDialog=false;  
          }else if(this.active==1&&this.showZcxjDialog){
            if(this.showOrgPickerTab1){
              this.showOrgPickerTab1=false; 
              return;
            }
            if(this.showzcxjDialogTypeDialog){
              this.showzcxjDialogTypeDialog=false; 
              return;
            } 
            if(this.showZcxjDialogStrTime){
              this.showZcxjDialogStrTime=false;
              return;
            }
            if(this.showZcxjDialogEndTime){
              this.showZcxjDialogEndTime=false;
              return;
            }
            this.showZcxjDialog=false;
          }else if(this.active==2&&this.showSzjsDialog){
            if(this.showSzjsDialogStrTime){
              this.showSzjsDialogStrTime=false;
              return;
            }
            if(this.showSzjsDialogEndTime){
              this.showSzjsDialogEndTime=false;
              return;
            }
            if(this.showOrgPickerTab2){
              this.showOrgPickerTab2=false; 
              return;
            }
            this.showSzjsDialog=false;
          }else if(this.active==3&&this.showWtsbDialog){
            if(this.showWtsbDialogStrTime){
              this.showWtsbDialogStrTime=false;
              return;
            }
            if(this.showWtsbDialogEndTime){
              this.showWtsbDialogEndTime=false;
              return;
            }
            if(this.showOrgPickerTab3){
              this.showOrgPickerTab3=false; 
              return;
            }
            if(this.showWtsbDialogType){
              this.showWtsbDialogType=false; 
              return;
            }
            this.showWtsbDialog=false;
          }else if(this.active==4&&this.showJytgDialog){
            if(this.showJytgDialogStrTime){
              this.showJytgDialogStrTime=false;
              return;
            }
            if(this.showJytgDialogEndTime){
              this.showJytgDialogEndTime=false;
              return;
            }
            if(this.showOrgPickerTab4){
              this.showOrgPickerTab4=false; 
              return;
            }
            if(this.showJytgDialogType){
              this.showJytgDialogType=false; 
              return;
            }
            this.showJytgDialog=false;
          }else{
           
              // if(this.tabviewName!='tabview0'){
              //     this.tabviewName='tabview0'
              //     this.pagename='我的工作'
              //     this.showCreat=false;
              //     this.showSet=false;
              //     this.active=0;
              //     localStorage.setItem('tabactiveNumber', '')
              // }else{
                  console.log('点击返回键,返回主界面'),
                  localStorage.setItem('tabactiveNumber', '')
                  // this.moaBridge_ha_djfupt.closeDoc({refresh:false,appcode:'djfupt'});
                  this.$router.push(
                      {
                          name:'mainview',
                          query:{
                            
                          }
                      }
                  )
              // }
          }
          
        }, 
        onchange(index){
            console.log("点击了第"+index+"个，当前为第"+this.active+"个");
            if(index==0){
                localStorage.setItem('tabactiveNumber', 0)
                this.tabviewName='tabview0'
                this.pagename='我的工作'
                this.showCreat=false;
                this.showSet=false;
            }else if(index==1){
                localStorage.setItem('tabactiveNumber', 1)
                this.tabviewName='tabview1'
                this.pagename='政策宣讲'
                if(this.haszcxjmenu){
                   this.showCreat=true;
                }else{
                   this.showCreat=false;
                }
                this.showSet=false;
            }else if(index==2){
                localStorage.setItem('tabactiveNumber', 2)
                this.tabviewName='tabview2'
                this.pagename='思政纪实'
                if(this.hassetmenuadd){
                   this.showCreat=true;
                }else{
                   this.showCreat=false;
                }
                if(this.hassetmenu){
                   this.showSet=true;
                }else{
                   this.showSet=false;
                }
               
            }else if(index==3){
                localStorage.setItem('tabactiveNumber', 3)
                this.tabviewName='tabview3'
                this.pagename='问题协调'
                if(this.haswtsbmenu){
                   this.showCreat=true;
                }else{
                   this.showCreat=false;
                }
                this.showSet=false;
            }else if(index==4){
                localStorage.setItem('tabactiveNumber', 4)
                this.tabviewName='tabview4'
                this.pagename='经验推广'
              if(this.hasjytgmenu){
                   this.showCreat=true;
                }else{
                   this.showCreat=false;
                }
                this.showSet=false;
            }
        },
        todraw(){
           if(this.active==0){
               
            }else if(this.active==1){
                this.$router.push(
                    {
                        name:'zcxjdetail',
                        query:{
                          location:'djfupt.start',
                          pmInsId:'',
                          todoType:'0',
                          processType:'C',
                          isdraw:'1'
                        }
                    }
                )
            }else if(this.active==2){
              this.$router.push ({
                name:'szjsdetail',
                params:{
                  isdraw:true,
                }
              })
            }else if(this.active==3){
              this.$router.push(
                    {
                        name:'wtsbdetail',
                        query:{
                          location:'djfupt.start',
                          pmInsId:'',
                          todoType:'0',
                          processType:'B',
                          isdraw:'1'
                        }
                    }
                )
            }else if(this.active==4){
               this.$router.push(
                    {
                        name:'jytgdetail',
                        query:{
                          location:'djfupt.start',
                          pmInsId:'',
                          todoType:'0',
                          processType:'A',
                          isdraw:'1'
                        }
                    }
                )
            }
        },
        toset(){
          this.$router.push({
            name:'szjssetlist',
            params:{
              userName:this.user.userName,
            },
          });
        },
         formatter(type, val) {
            if (type === 'year') {
              return `${val}年`;
            } else if (type === 'month') {
              return `${val}月`;
            } else if (type === 'day') {
              return `${val}日`;
            } else if (type === 'hour') {
              return `${val}时`;
            } else if (type === 'minute') {
              return `${val}分`;
            }
            return val;
          },
          addlistener(){
             if (window.history && window.history.pushState) {
                    console.log('再次注册物理返回键监听');
                    history.pushState(null, null, document.URL);
                    window.addEventListener('popstate', this.gotoMobile, false);//false阻止默认事件
                }
          }
    },
  destroyed () {
    window.removeEventListener('popstate',this.gotoMobile,false);//false阻止默认事件
  },
    
}
</script>
<style scoped>
  .item{
      text-align: center;
      width:20%
  }
  .pageview{
      height:100%;
      padding-top: 50px;
      margin-bottom: 60px;
      font-size: 12px;
  }
  .tabview{
      position: fixed;
  bottom: 0;
  width: 100%;
  line-height: var(--footer-height);
  background-color: gray;
  padding-top: 20px;
  padding-bottom: 20px;
  }
  .vh100{
    width: 100%;
  }
  .pf-20{
    padding-right: 20px;
  }
</style>